//Emu's
WPP_COLIDE_NORMAL = 0
WPP_COLIDE_SOLID = 1
WPP_COLIDE_GHOST = 2

function _R.Entity:WPP_SetColide( Int )
	if ( !self.WPP ) then return end
	self.WPP.Collide = Int
end

hook.Add("WPP_SetColide","WPP",function(Entity,Int)
	Entity:WPP_SetColide( Int )
	if ( SERVER ) then
		umsg.Start( "WPP_SetColide" )
			umsg.Entity( self )
			umsg.Char( Int )
		umsg.End()
	end
end)

if ( CLIENT ) then

	usermessage.Hook("WPP_SetColide",function(um) hook.Call("WPP_SetColide",GAMEMODE,um:ReadEntity(),um:ReadChar()) end)
	
end


hook.Add("ShouldCollide","WPP",function(A,B)
	local N = GetConVarNumber("wpp_anti_colide")
	if ( N > 1 ) then return end
	if ( !A.WPP ) or ( !B.WPP ) then return end
	if ( A.WPP.Collide == WPP_COLIDE_NORMAL ) and ( B.WPP.Collide == WPP_COLIDE_NORMAL ) then return end
	if ( A.WPP.Collide == WPP_COLIDE_SOLID ) or ( B.WPP.Collide == WPP_COLIDE_SOLID ) then return true end
	if ( A.WPP.Collide == WPP_COLIDE_GHOST ) or ( B.WPP.Collide == WPP_COLIDE_GHOST ) then return false end
end)